#ifndef __MEM_UTILS_H
#define __MEM_UTILS_H
 
typedef unsigned long  u32;
typedef unsigned short u16;
typedef unsigned char  u8; 

#ifndef NULL
#define NULL 0
#endif
#define MEM_BLOCK_SIZE   32         
#define MAX_MEM_SIZE   512     
#define MEM_ALLOC_TABLE_SIZE MAX_MEM_SIZE/MEM_BLOCK_SIZE

struct _m_mallco_dev
{
		void (*init)(void);  
		u8 (*perused)(void);      
		u8  membase[MAX_MEM_SIZE];   
		u16 memmap[MEM_ALLOC_TABLE_SIZE];  
		u8  memrdy;        
};
extern struct _m_mallco_dev mallco_dev;  
void mymemset(void *s,u8 c,u32 count);  
void mymemcpy(void *des,void *src,u32 n);
void mem_init(void);      
u32 mem_malloc(u32 size);     
u8 mem_free(u32 offset);     
u8 mem_perused(void);      

void myfree(void *ptr);       
void *mymalloc(u32 size);     
void *myrealloc(void *ptr,u32 size);  
   
#endif